\(\int \frac {x^2 (1+x)^2}{\sqrt {1-x^2}} \, dx\) [55]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 63 \[ \int \frac {x^2 (1+x)^2}{\sqrt {1-x^2}} \, dx=-\frac {2}{3} x^2 \sqrt {1-x^2}-\frac {1}{4} x^3 \sqrt {1-x^2}-\frac {1}{24} (32+21 x) \sqrt {1-x^2}+\frac {7 \arcsin (x)}{8} \]

[Out]

7/8*arcsin(x)-2/3*x^2*(-x^2+1)^(1/2)-1/4*x^3*(-x^2+1)^(1/2)-1/24*(32+21*x)*(-x^2+1)^(1/2)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {1823, 847, 794, 222} \[ \int \frac {x^2 (1+x)^2}{\sqrt {1-x^2}} \, dx=\frac {7 \arcsin (x)}{8}-\frac {2}{3} \sqrt {1-x^2} x^2-\frac {1}{24} (21 x+32) \sqrt {1-x^2}-\frac {1}{4} \sqrt {1-x^2} x^3 \]

[In]

Int[(x^2*(1 + x)^2)/Sqrt[1 - x^2],x]

[Out]

(-2*x^2*Sqrt[1 - x^2])/3 - (x^3*Sqrt[1 - x^2])/4 - ((32 + 21*x)*Sqrt[1 - x^2])/24 + (7*ArcSin[x])/8

Rule 222

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSin[Rt[-b, 2]*(x/Sqrt[a])]/Rt[-b, 2], x] /; FreeQ[{a, b}
, x] && GtQ[a, 0] && NegQ[b]

Rule 794

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((e*f + d*g)*(2*p
+ 3) + 2*e*g*(p + 1)*x)*((a + c*x^2)^(p + 1)/(2*c*(p + 1)*(2*p + 3))), x] - Dist[(a*e*g - c*d*f*(2*p + 3))/(c*
(2*p + 3)), Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, p}, x] &&  !LeQ[p, -1]

Rule 847

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[g*(d + e*x)^
m*((a + c*x^2)^(p + 1)/(c*(m + 2*p + 2))), x] + Dist[1/(c*(m + 2*p + 2)), Int[(d + e*x)^(m - 1)*(a + c*x^2)^p*
Simp[c*d*f*(m + 2*p + 2) - a*e*g*m + c*(e*f*(m + 2*p + 2) + d*g*m)*x, x], x], x] /; FreeQ[{a, c, d, e, f, g, p
}, x] && NeQ[c*d^2 + a*e^2, 0] && GtQ[m, 0] && NeQ[m + 2*p + 2, 0] && (IntegerQ[m] || IntegerQ[p] || IntegersQ
[2*m, 2*p]) &&  !(IGtQ[m, 0] && EqQ[f, 0])

Rule 1823

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Expon[Pq, x], f = Coeff[Pq, x,
 Expon[Pq, x]]}, Simp[f*(c*x)^(m + q - 1)*((a + b*x^2)^(p + 1)/(b*c^(q - 1)*(m + q + 2*p + 1))), x] + Dist[1/(
b*(m + q + 2*p + 1)), Int[(c*x)^m*(a + b*x^2)^p*ExpandToSum[b*(m + q + 2*p + 1)*Pq - b*f*(m + q + 2*p + 1)*x^q
 - a*f*(m + q - 1)*x^(q - 2), x], x], x] /; GtQ[q, 1] && NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, b, c, m, p}, x]
 && PolyQ[Pq, x] && ( !IGtQ[m, 0] || IGtQ[p + 1/2, -1])

Rubi steps \begin{align*} \text {integral}& = -\frac {1}{4} x^3 \sqrt {1-x^2}-\frac {1}{4} \int \frac {(-7-8 x) x^2}{\sqrt {1-x^2}} \, dx \\ & = -\frac {2}{3} x^2 \sqrt {1-x^2}-\frac {1}{4} x^3 \sqrt {1-x^2}+\frac {1}{12} \int \frac {x (16+21 x)}{\sqrt {1-x^2}} \, dx \\ & = -\frac {2}{3} x^2 \sqrt {1-x^2}-\frac {1}{4} x^3 \sqrt {1-x^2}-\frac {1}{24} (32+21 x) \sqrt {1-x^2}+\frac {7}{8} \int \frac {1}{\sqrt {1-x^2}} \, dx \\ & = -\frac {2}{3} x^2 \sqrt {1-x^2}-\frac {1}{4} x^3 \sqrt {1-x^2}-\frac {1}{24} (32+21 x) \sqrt {1-x^2}+\frac {7}{8} \sin ^{-1}(x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.84 \[ \int \frac {x^2 (1+x)^2}{\sqrt {1-x^2}} \, dx=\frac {1}{24} \sqrt {1-x^2} \left (-32-21 x-16 x^2-6 x^3\right )+\frac {7}{4} \arctan \left (\frac {x}{-1+\sqrt {1-x^2}}\right ) \]

[In]

Integrate[(x^2*(1 + x)^2)/Sqrt[1 - x^2],x]

[Out]

(Sqrt[1 - x^2]*(-32 - 21*x - 16*x^2 - 6*x^3))/24 + (7*ArcTan[x/(-1 + Sqrt[1 - x^2])])/4

Maple [A] (verified)

Time = 0.39 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.59

method result size
risch \(\frac {\left (6 x^{3}+16 x^{2}+21 x +32\right ) \left (x^{2}-1\right )}{24 \sqrt {-x^{2}+1}}+\frac {7 \arcsin \left (x \right )}{8}\) \(37\)
trager \(\left (-\frac {1}{4} x^{3}-\frac {2}{3} x^{2}-\frac {7}{8} x -\frac {4}{3}\right ) \sqrt {-x^{2}+1}+\frac {7 \operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \ln \left (\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \sqrt {-x^{2}+1}+x \right )}{8}\) \(54\)
default \(-\frac {x^{3} \sqrt {-x^{2}+1}}{4}-\frac {7 x \sqrt {-x^{2}+1}}{8}+\frac {7 \arcsin \left (x \right )}{8}-\frac {2 x^{2} \sqrt {-x^{2}+1}}{3}-\frac {4 \sqrt {-x^{2}+1}}{3}\) \(57\)
meijerg \(\frac {i \left (i \sqrt {\pi }\, x \sqrt {-x^{2}+1}-i \sqrt {\pi }\, \arcsin \left (x \right )\right )}{2 \sqrt {\pi }}+\frac {\frac {4 \sqrt {\pi }}{3}-\frac {\sqrt {\pi }\, \left (4 x^{2}+8\right ) \sqrt {-x^{2}+1}}{6}}{\sqrt {\pi }}-\frac {i \left (-\frac {i \sqrt {\pi }\, x \left (10 x^{2}+15\right ) \sqrt {-x^{2}+1}}{20}+\frac {3 i \sqrt {\pi }\, \arcsin \left (x \right )}{4}\right )}{2 \sqrt {\pi }}\) \(102\)

[In]

int(x^2*(1+x)^2/(-x^2+1)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/24*(6*x^3+16*x^2+21*x+32)*(x^2-1)/(-x^2+1)^(1/2)+7/8*arcsin(x)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.71 \[ \int \frac {x^2 (1+x)^2}{\sqrt {1-x^2}} \, dx=-\frac {1}{24} \, {\left (6 \, x^{3} + 16 \, x^{2} + 21 \, x + 32\right )} \sqrt {-x^{2} + 1} - \frac {7}{4} \, \arctan \left (\frac {\sqrt {-x^{2} + 1} - 1}{x}\right ) \]

[In]

integrate(x^2*(1+x)^2/(-x^2+1)^(1/2),x, algorithm="fricas")

[Out]

-1/24*(6*x^3 + 16*x^2 + 21*x + 32)*sqrt(-x^2 + 1) - 7/4*arctan((sqrt(-x^2 + 1) - 1)/x)

Sympy [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.95 \[ \int \frac {x^2 (1+x)^2}{\sqrt {1-x^2}} \, dx=- \frac {x^{3} \sqrt {1 - x^{2}}}{4} - \frac {2 x^{2} \sqrt {1 - x^{2}}}{3} - \frac {7 x \sqrt {1 - x^{2}}}{8} - \frac {4 \sqrt {1 - x^{2}}}{3} + \frac {7 \operatorname {asin}{\left (x \right )}}{8} \]

[In]

integrate(x**2*(1+x)**2/(-x**2+1)**(1/2),x)

[Out]

-x**3*sqrt(1 - x**2)/4 - 2*x**2*sqrt(1 - x**2)/3 - 7*x*sqrt(1 - x**2)/8 - 4*sqrt(1 - x**2)/3 + 7*asin(x)/8

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.89 \[ \int \frac {x^2 (1+x)^2}{\sqrt {1-x^2}} \, dx=-\frac {1}{4} \, \sqrt {-x^{2} + 1} x^{3} - \frac {2}{3} \, \sqrt {-x^{2} + 1} x^{2} - \frac {7}{8} \, \sqrt {-x^{2} + 1} x - \frac {4}{3} \, \sqrt {-x^{2} + 1} + \frac {7}{8} \, \arcsin \left (x\right ) \]

[In]

integrate(x^2*(1+x)^2/(-x^2+1)^(1/2),x, algorithm="maxima")

[Out]

-1/4*sqrt(-x^2 + 1)*x^3 - 2/3*sqrt(-x^2 + 1)*x^2 - 7/8*sqrt(-x^2 + 1)*x - 4/3*sqrt(-x^2 + 1) + 7/8*arcsin(x)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.48 \[ \int \frac {x^2 (1+x)^2}{\sqrt {1-x^2}} \, dx=-\frac {1}{24} \, {\left ({\left (2 \, {\left (3 \, x + 8\right )} x + 21\right )} x + 32\right )} \sqrt {-x^{2} + 1} + \frac {7}{8} \, \arcsin \left (x\right ) \]

[In]

integrate(x^2*(1+x)^2/(-x^2+1)^(1/2),x, algorithm="giac")

[Out]

-1/24*((2*(3*x + 8)*x + 21)*x + 32)*sqrt(-x^2 + 1) + 7/8*arcsin(x)

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.49 \[ \int \frac {x^2 (1+x)^2}{\sqrt {1-x^2}} \, dx=\frac {7\,\mathrm {asin}\left (x\right )}{8}-\sqrt {1-x^2}\,\left (\frac {x^3}{4}+\frac {2\,x^2}{3}+\frac {7\,x}{8}+\frac {4}{3}\right ) \]

[In]

int((x^2*(x + 1)^2)/(1 - x^2)^(1/2),x)

[Out]

(7*asin(x))/8 - (1 - x^2)^(1/2)*((7*x)/8 + (2*x^2)/3 + x^3/4 + 4/3)